POV-Ray : Newsgroups : povray.advanced-users : movie within : Re: movie within Server Time
29 Jul 2024 02:23:29 EDT (-0400)
  Re: movie within  
From: Warp
Date: 31 Jan 2004 05:14:27
Message: <401b8003@news.povray.org>
Dan P <dan### [at] yahoocom> wrote:
> Ah yes, but remember: we might take this code and wrap it in a class later,
> so having that fflush there might help us avoid future bugs.

  If you are going to enhance the program to something which may be used
somewhere where flushing can be important, you can add it then. :)

> Also, even
> though the C standard requires this, experience has shown me that not
> everybody keeps to the standard when they write their C compilers (see
> Visual Studio).

  Can you imagine a compiler which does not output all data written to
a file if you don't fflush() explicitly? Can you imagine how many buggy
programs that would create? Almost every single program would misbehave
if this was the case.
  I can't imagine that. Believe me: Compilers do generate code which flushes
the output.

> To me, flushing the buffer is kindof like closing a file. I
> don't have to at the end, but it's good practice and it really doesn't hurt
> anything if the stream isn't buffered.

  I see no reason. The stream *will* be flushed, period. There's no doubt
about that.
  If you use fflush() too much you are just potentially creating inefficient
code.

  There are *tons* of things which one really *should* do but which no-one
does because of laziness or whatever (for example, have you ever checked
that your printf() call really succeeded?). However, I don't think calling
fflush() is one of them.

  fflush() is important and handy when you really have to make sure that
the output is flushed immediately, but using it needlessly is a waste
of code. :)

> Also, the reason I output using STDOUT is because

  Did someone put that decision into question?

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.